# ros2 run nav2_map_server map_saver_cli -f ~/map

import launch_ros.actions
from launch import LaunchDescription


def generate_launch_description():
    map_saver = launch_ros.actions.Node(
        package='nav2_map_server',
        executable='map_saver_cli',
        output='screen',
        arguments=[
            '-f', '/home/michael/bichon/install/bichon_nav2/share/bichon_nav2/map/bichon'],

        parameters=[{'save_map_timeout': 20000.0},
            {'free_thresh_default': 0.196}]

    )
    map_backup = launch_ros.actions.Node(
        package='nav2_map_server',
        executable='map_saver_cli',
        name='map_backup',
        output='screen',
        arguments=[
            '-f', '/home/michael/bichon/src/algorithm/bichon_nav2/map/bichon'],

        parameters=[{'save_map_timeout': 20000.0},
                    {'free_thresh_default': 0.196}]
    )
    ld = LaunchDescription()

    ld.add_action(map_saver)
    ld.add_action(map_backup)
    return ld
